<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html > 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions">

<ui:composition>
<div class="row-fluid" style="background: #FFFFFF;">
<div class="span1"></div>
	<div class="span10">
		<h3>Cadastrar Pagamento</h3>
		<br />
		<h:form prependId="false" id="formCadPagamento">
			<p:growl id="growl" showDetail="true" sticky="true" life="6000"/>
			<div class="row-fluid">
				<div class="span2">
					<h:outputLabel for="clientePag" value="Nome do Cliente: " />
				</div>
				<div class="span4">
					<h:selectOneMenu id="clientePag" styleClass="inputAjust"
						value="#{cadPagamentoBean.clienteSelecionado}" requiredMessage="Escolha o Cliente" required="true">
						<f:selectItem itemLabel="Selecione o Cliente" itemValue="" />
						<f:selectItems value="#{cadPagamentoBean.listaItemCliente}" />
						
						<f:ajax listener="#{cadPagamentoBean.zeraLista()}" render=":formCadPagamento"/>
					</h:selectOneMenu>
				</div>
			</div>
			
			<div class="row-fluid" style="margin-top: 15px;">
				<div class="span2"><h:outputLabel value="Data do Pagamento: " /></div>
				<div class="span4">
					<p:calendar id="data" value="#{cadPagamentoBean.dataPagCalendar}" locale="pt_BR" pattern="dd/MM/yyyy" title="Campo obrigaorio. Informe a data" label="data da Compra" />
				</div>
			</div>
			
			<div class="row-fluid" style="margin-top: 15px;">
				<div class="span2"><h:outputLabel value="Valor do Pagamento: " /></div>
				<div class="span4">
					<!-- <p:inputText id="valorPag" styleClass="inputAjust2" value="#{cadPagamentoBean.valorPag}" required="true" requiredMessage="Digite o Valor do Pagamento" label="valorPag" /> -->
					<pe:inputNumber id="valorPag" value="#{cadPagamentoBean.valorPag}" symbol="R$ " decimalSeparator="," thousandSeparator="." > 
        				<f:validateDoubleRange minimum="00" maximum="150"/>
        			</pe:inputNumber>
				</div>
				<div class="span3"><h:outputLabel value="Ex: 19.90" style="margin-left:20px;"/></div>
			</div>
			
			<div class="span12">
				<div class="span3">
					<p:commandButton id="btCadPagamento" value="Cadastrar" ajax="false" 
						actionListener="#{cadPagamentoBean.cadastrarPagamento}" update="@this growl :formCadPagamento" 
						icon="ui-icon-check" style="margin:0; margin-top:15px;" />
				</div>
			</div>
			<div class="span12"></div>
			<div class="span12"></div>
		</h:form>
	</div>
	<div class="span1"></div>
</div>
</ui:composition>
</html>